#include<sys/types.h>
#include<sys/stat.h>
#include<fcntl.h>
#include<unistd.h>
#include<stdio.h>

int main(){
  int fd = open("mytext",O_RDONLY);
  dup2(fd,0);
  char buffer[1024]={0};
  while(1){
    char* tmp = fgets(buffer,sizeof(buffer),stdin);
    if(tmp==NULL) break;
    printf("%s",buffer);
  }
  close(fd);
  return 0;
}
